//
//  CommissionSubsidiaryTableViewCell.m
//  GLGW_Shoping
//
//  Created by whx on 2018/12/7.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "CommissionSubsidiaryTableViewCell.h"

@interface CommissionSubsidiaryTableViewCell ()
{
    GLGWLabel *comeFromLab;
    GLGWLabel *tipaLab;
}
@end

@implementation CommissionSubsidiaryTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.backgroundColor = [UIColor whiteColor];
        GLGWView *baView = [[GLGWView alloc] initWithInSuperView:self];
        [baView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(@(kHeightProportion_In_iPhoneTriploid(15)));
            make.left.equalTo(self).offset(kWidthProportion_In_iPhoneTriploid(15));
            make.right.equalTo(self).offset(-kWidthProportion_In_iPhoneTriploid(15));
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(78)));
        }];
        [baView setViewShadowWidth:6 theCornerRadius:6];
        baView.backgroundColor = [UIColor whiteColor];
        
        GLGWLabel *lab = [[GLGWLabel alloc] initWithFont:SYSTEMFONT(16) theColor:kColor_Rule_Black inSuperView:baView];
        lab.text = @"求购补贴";
        [lab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(baView).offset(kWidthProportion_In_iPhoneTriploid(15));
            make.top.equalTo(baView.mas_top).offset(kHeightProportion_In_iPhoneTriploid(10));
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(30)));
        }];
        
        GLGWLabel *moneyLab = [[GLGWLabel alloc] initWithFont:SYSTEMFONT(16) theColor:[UIColor colorWithHexString:@"#EC5353"] inSuperView:baView];
        NSString *str = @"¥3030";
        NSAttributedString *att = [GLGWLabel bllChangeStr:str changewithStr:@"¥" changeColoer:[UIColor colorWithHexString:@"#EC5353"] withFont:SYSTEMFONT(12)];
        [moneyLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(baView.mas_right).offset(-kWidthProportion_In_iPhoneTriploid(24));
            make.top.equalTo(baView.mas_top).offset(kHeightProportion_In_iPhoneTriploid(17));
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(22)));
        }];
        moneyLab.attributedText = att;
        
        GLGWLabel *timeLab = [[GLGWLabel alloc] initWithFont:SYSTEMFONT(12) theColor:[UIColor colorWithHexString:@"#999999"] inSuperView:baView];
        timeLab.text = @"2018-08-21 12:12:12";
        [timeLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(lab.mas_bottom).offset(kHeightProportion_In_iPhoneTriploid(8));
            make.left.equalTo(lab.mas_left);
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(17)));
        }];
        
        GLGWImageView *jianT = [[GLGWImageView alloc] initWithImageName:@"" inSuperView:baView];
        jianT.backgroundColor = kRandomColor;
        [jianT mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(moneyLab.mas_centerY);
            make.right.equalTo(baView.mas_right).offset(-kWidthProportion_In_iPhoneTriploid(13));
            make.width.equalTo(@(kWidthProportion_In_iPhoneTriploid(6)));
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(10)));
        }];
    }
    return self;
}

- (void)setComeStr:(NSString *)comeStr
{
    _comeStr = comeStr;
    comeFromLab.text = comeStr;
}

- (void)setTipStr:(NSString *)tipStr
{
    _tipStr = tipStr;
    tipaLab.text = tipStr;
}

- (void)setMoneyLab:(GLGWLabel *)moneyLab
{
    _moneyLab = moneyLab;
}

@end
